﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using BugTracker.WebUX.WebCode;

namespace BugTracker.WebUX.Shared
{
    /// <summary>
    /// Summary description for FetchGridViewImage
    /// </summary>
    public class FetchGridViewSessionImage : IHttpHandler
    {

        public void ProcessRequest(HttpContext context)
        {
            byte[] img = context.Session[BTHttpApplication.Constants.GRIDVIEW_IMG_KEY] as byte[];
            if (img != null)
            {
                context.Response.ContentType = "image/jpg";
                context.Response.BinaryWrite(img);
                context.Response.Flush();
            }
        }

        public bool IsReusable
        {
            get
            {
                return false;
            }
        }
    }
}